//
//  Coupons_TableViewCell.swift
//  Pods
//
//  Created by eme on 2017/3/29.
//
//

import UIKit

class Coupons_TableViewCell: UITableViewCell {
    
    @IBOutlet weak var bg_Bottom: UIImageView!                          //背景图片_底部
    
    @IBOutlet weak var bg_Top: UIImageView!                             //背景图片_顶部
    
    @IBOutlet weak var title_Label: UILabel!                            //标题
    
    @IBOutlet weak var price_Label: UILabel!                            //价格
    
    @IBOutlet weak var conditions_Label: UILabel!                       //使用条件
    
    @IBOutlet weak var time_Label: UILabel!                             //时间
    
    @IBOutlet weak var Coupons_type: UIImageView!                       //优惠券类型
    
    @IBOutlet weak var width_imageView: NSLayoutConstraint!             //适用商品宽度
    
    var item:VouchersModel?{
        didSet{
            if let model = item{
                self.title_Label.text = model.vname
                self.price_Label.text = model.cost
                self.conditions_Label.text = model.money
            }
        }
    }
    var type:Int?{
        didSet{
            if let status = type{
                
                if status != 0{
                    
                    self.bg_Bottom.image = UIImage(named: "YHJ_SX_B", in: AryaCore.bundle, compatibleWith: nil)
                    self.bg_Top.image = UIImage(named: "YHJ_SX_T" , in: AryaCore.bundle, compatibleWith: nil)
                    self.Coupons_type.image = UIImage(named: "")
                    self.width_imageView.constant = 1
                    
                }else{
                    self.bg_Bottom.image = UIImage(named: "YHJ_B", in: AryaCore.bundle, compatibleWith: nil)
                    self.bg_Top.image = UIImage(named: "YHJ_T", in: AryaCore.bundle, compatibleWith: nil)
                    self.Coupons_type.image = UIImage(named: "KY_Image", in: AryaCore.bundle, compatibleWith: nil)
                    self.width_imageView.constant = 43
                }
            }
        }
    }
    override func awakeFromNib() {
        super.awakeFromNib()
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)

        // Configure the view for the selected state
    }

}
